function visualizeImprovedSetPredictions(baseline, data, out_dir, file_prefix)

load_settings;

%%
% PROBLEM: EVALUATING ON TEST DATA AS WELL AS TRAINING DATA....
for ix = 1:size(data,1)
    for kx = 1:size(data,2)
        if ~isempty(data(ix,kx).cam_id)
            [ppl_new, ~] = eval_baseline(baseline, data(ix,kx).ppl_hogs, ones(size(data(ix,kx).ppl_hogs,1),1), settings);
            [bg_new, ~] = eval_baseline(baseline, data(ix,kx).bg_hogs, -ones(size(data(ix,kx).bg_hogs,1),1), settings);
            
            disp(['Generating overview image for camera '  num2str(data(ix,kx).cam_id) ', image: ' data(ix,kx).filename]);
            img = imread([image_root sprintf('%08d', data(ix,kx).cam_id) '/' data(ix,kx).filename]);
            out_file = [overview_root 'predictions/' out_dir '/' file_prefix '_' sprintf('%08d', data(ix,kx).cam_id) '_' data(ix,kx).filename];
            imshow(img);
            title(out_file);
            for jx = 1:size(data(ix,kx).ppl_rects,1)
                color = 'g';
                if ppl_new.p(jx) == -1;
                    color = 'r';
                end
                rectangle('Position', data(ix,kx).ppl_rects(jx,:), 'EdgeColor', color);
            end
            for jx = 1:size(data(ix,kx).bg_rects,1)
                color = 'b';
                if bg_new.p(jx) == 1;
                    color = 'm';
                end
                rectangle('Position', data(ix,kx).bg_rects(jx,:), 'EdgeColor', color);
            end
            hold off;
            pause(1);
            f=getframe(gca);
            [X, map] = frame2im(f);
            pause(2);
            imwrite(X, out_file, 'jpeg');
            pause(2);
        end
    end
end
end